import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_phone_direct_caller/flutter_phone_direct_caller.dart';
import 'package:flutter_phone_direct_caller/flutter_phone_direct_caller_platform_interface.dart';
import 'package:flutter_phone_direct_caller/flutter_phone_direct_caller_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterPhoneDirectCallerPlatform
    with MockPlatformInterfaceMixin
    implements FlutterPhoneDirectCallerPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterPhoneDirectCallerPlatform initialPlatform = FlutterPhoneDirectCallerPlatform.instance;

  test('$MethodChannelFlutterPhoneDirectCaller is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterPhoneDirectCaller>());
  });

  test('getPlatformVersion', () async {
    FlutterPhoneDirectCaller flutterPhoneDirectCallerPlugin = FlutterPhoneDirectCaller();
    MockFlutterPhoneDirectCallerPlatform fakePlatform = MockFlutterPhoneDirectCallerPlatform();
    FlutterPhoneDirectCallerPlatform.instance = fakePlatform;

    expect(await flutterPhoneDirectCallerPlugin.getPlatformVersion(), '42');
  });
}
